﻿#region Usings



#endregion

namespace ScrumTable.UI.View.WinTouch.UserControls.Menu.MenuItems
{
    /// <summary>
    ///  a list of menu entries. This list create automatically the parent link. 
    /// </summary>
    public class MenuList : System.Collections.ObjectModel.Collection<MenuEntry>
    {

        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------
        private readonly IMenu _parent;

        #endregion
        
        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------


        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------
        public MenuList(IMenu parent)
        {
            _parent = parent;
        }
      
        #endregion


        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        protected override void InsertItem(int index, MenuEntry item)
        {
            item.Parent = _parent;
            base.InsertItem(index, item);
        }
        #endregion


        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------
      

        #endregion

    }
}
